package platform;

import java.awt.Rectangle;

import graphics.WorldDisplayer;
import physics.Ball;
import physics.Coordinate;
import physics.Vector;
import physics.World;

public class Character extends Ball {
Vector gravity;
	
	public Character(int x, int y, double diameter, double mass,Vector initialVector) {
		super(x, y, diameter, mass, initialVector);
		gravity = initialVector;
	}

	
	@Override
	public void act(){
		if(getWorld() != null){
			this.getVector().addVector(new Vector(-Math.PI/2, 1));
			for (Vector v : getWorld().getActingVectors(this.getLocation()))
				this.getVector().addVector(v);
					updatePosition();
		}
//		
//		updatePosition();
	}
	
public static void main(String args[]){
		Character c = new Character(500, 500, 5, 100, new Vector(Math.PI/2, 100));
		World w = new World();
		
		for (int i = 0; i < 10; i++) {
			TileBlock b = new TileBlock(new Coordinate(i*64, 800), new Rectangle(0, 0, 64,64), 200);
			w.addObstacle(b);
		}
		
		w.addObstacle(c);
		WorldDisplayer d = new WorldDisplayer(w);
	}
	
}
